<?php

namespace app\common\service;

use think\facade\Config;

class PayService
{

    /**
     * 配置
     * @var array
     */
    private $config = [];

    /**
     * 构造函数
     */
    public function __construct()
    {
        $config = Config::get('pay');
        $this->config = $config['yunGouOs'];
    }

    /**
     * buildPaySign
     * @param array $data
     * @return string
     */
    private function buildPaySign(array $data): string
    {
        $key = $this->config['mch_key'];;
        ksort($data);
        return strtoupper(md5(urldecode(http_build_query($data)) . '&key=' . $key));
    }
}